/*  1:   */ package org.jetbrains.lang.manifest.psi.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.extapi.psi.PsiFileBase;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.psi.FileViewProvider;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.lang.manifest.ManifestFileTypeFactory;
import org.jetbrains.lang.manifest.ManifestLanguage;
import org.jetbrains.lang.manifest.psi.Header;
import org.jetbrains.lang.manifest.psi.ManifestFile;
import org.jetbrains.lang.manifest.psi.Section;

import java.util.List;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */
/* 16:   */ 
/* 17:   */ public class ManifestFileImpl
/* 18:   */   extends PsiFileBase
/* 19:   */   implements ManifestFile
/* 20:   */ {
/* 21:   */   public ManifestFileImpl(FileViewProvider paramFileViewProvider)
/* 22:   */   {
/* 23:46 */     super(paramFileViewProvider, ManifestLanguage.INSTANCE);
/* 24:   */   }
/* 25:   */   
/* 26:   */   @NotNull
/* 27:   */   public FileType getFileType()
/* 28:   */   {
/* 29:52 */     LanguageFileType tmp3_0 = ManifestFileTypeFactory.MANIFEST;
/* 30:52 */     if (tmp3_0 == null) {
/* 31:52 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/lang/manifest/psi/impl/ManifestFileImpl", "getFileType" }));
/* 32:   */     }
/* 33:52 */     return tmp3_0;
/* 34:   */   }
/* 35:   */   
/* 36:   */   @NotNull
/* 37:   */   public List<Section> getSections()
/* 38:   */   {
/* 39:58 */     List tmp6_3 = PsiTreeUtil.getChildrenOfTypeAsList(this, Section.class);
/* 40:58 */     if (tmp6_3 == null) {
/* 41:58 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/lang/manifest/psi/impl/ManifestFileImpl", "getSections" }));
/* 42:   */     }
/* 43:58 */     return tmp6_3;
/* 44:   */   }
/* 45:   */   
/* 46:   */   @Nullable
/* 47:   */   public Section getMainSection()
/* 48:   */   {
/* 49:64 */     return (Section)findChildByClass(Section.class);
/* 50:   */   }
/* 51:   */   
/* 52:   */   @NotNull
/* 53:   */   public List<Header> getHeaders()
/* 54:   */   {
/* 55:70 */     List tmp9_6 = PsiTreeUtil.getChildrenOfTypeAsList(getFirstChild(), Header.class);
/* 56:70 */     if (tmp9_6 == null) {
/* 57:70 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/lang/manifest/psi/impl/ManifestFileImpl", "getHeaders" }));
/* 58:   */     }
/* 59:70 */     return tmp9_6;
/* 60:   */   }
/* 61:   */   
/* 62:   */   @Nullable
/* 63:   */   public Header getHeader(@NotNull String paramString)
/* 64:   */   {
/* 65:76 */     if (paramString == null) {
/* 66:76 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/lang/manifest/psi/impl/ManifestFileImpl", "getHeader" }));
/* 67:   */     }
/* 68:76 */     Header localHeader = (Header)PsiTreeUtil.findChildOfType(getFirstChild(), Header.class);
/* 69:77 */     while (localHeader != null)
/* 70:   */     {
/* 71:78 */       if (paramString.equals(localHeader.getName())) {
/* 72:79 */         return localHeader;
/* 73:   */       }
/* 74:81 */       localHeader = (Header)PsiTreeUtil.getNextSiblingOfType(localHeader, Header.class);
/* 75:   */     }
/* 76:83 */     return null;
/* 77:   */   }
/* 78:   */   
/* 79:   */   public String toString()
/* 80:   */   {
/* 81:88 */     return "ManifestFile:" + getName();
/* 82:   */   }
/* 83:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.lang.manifest.psi.impl.ManifestFileImpl

 * JD-Core Version:    0.7.0.1

 */